/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.orderoid.ejb.domain;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Dahlia
 */
@Entity
@Table(name = "civilite")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Civilite.findAll", query = "SELECT c FROM Civilite c"),
    @NamedQuery(name = "Civilite.findByIdCivilite", query = "SELECT c FROM Civilite c WHERE c.idCivilite = :idCivilite"),
    @NamedQuery(name = "Civilite.findByLibelle", query = "SELECT c FROM Civilite c WHERE c.libelle = :libelle")})
public class Civilite implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_civilite")
    private Integer idCivilite;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "libelle")
    private String libelle;

    public Civilite() {
    }

    public Civilite(Integer idCivilite) {
        this.idCivilite = idCivilite;
    }

    public Civilite(Integer idCivilite, String libelle) {
        this.idCivilite = idCivilite;
        this.libelle = libelle;
    }

    public Integer getIdCivilite() {
        return idCivilite;
    }

    public void setIdCivilite(Integer idCivilite) {
        this.idCivilite = idCivilite;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCivilite != null ? idCivilite.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Civilite)) {
            return false;
        }
        Civilite other = (Civilite) object;
        if ((this.idCivilite == null && other.idCivilite != null) || (this.idCivilite != null && !this.idCivilite.equals(other.idCivilite))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.orderoid.ejb.domain.Civilite[ idCivilite=" + idCivilite + " ]";
    }
    
}
